<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全局组件</title>
</head>
<body>
<div id="app1">
    <cpn1></cpn1>
</div>

<div id="app2">
    <cpn1></cpn1>
</div>

<script !src="" type="module">
    import {createApp, defineComponent} from "../../../../js/vue.esm-browser.js";

    // 定义一个组件
    let component = defineComponent({
        template: "<h1>Hello, World!</h1>"
    });


    let app1 = createApp({
        setup() {
            return {}
        }
    })
    // 注册组件
    app1.component("cpn1", component)
    app1.mount("#app1")


    let app2 = createApp({
        setup() {
            return {}
        }
    })
    // 注册组件
    app2.component("cpn2", component)
    app2.mount("#app2")

</script>
</body>
</html>